package com.sevens.service.impl;

import java.util.List;

import com.sevens.dao.ResourceDao;
import com.sevens.service.ResourceService;
import com.sevens.vo.News;
import com.sevens.vo.Resource;

public class ResourceServiceImpl implements ResourceService{
	
	private ResourceDao resourceDao;

	public ResourceDao getResourceDao() {
		return resourceDao;
	}
	
	public void setResourceDao(ResourceDao resourceDao) {
		this.resourceDao = resourceDao;
	}
	
	public boolean saveResource(Resource resource) {
		
		if(resourceDao.saveResource(resource)!= null)
			return true;
		else
			return false;
	}

	public List<Resource> queryResource(Resource resource) {
		
		return this.resourceDao.queryResource(resource);
	}

	public List<Resource> queryAllResource() {
		
		return this.resourceDao.queryAllResource();
	}

	public boolean editResource(Resource resource) {
		boolean bool = this.resourceDao.editResource(resource);
		return bool;
	}

	public boolean deleteResourceById(int resourceId) {
		boolean bool = this.resourceDao.deleteResourceById(resourceId);
		return bool;
	}

	public boolean deleteResource(Resource resource) {
		boolean bool = this.resourceDao.deleteResource(resource);
		return bool;
	}

	@Override
	public Resource queryResourceById(int resourceId) {
		Resource resource=this.resourceDao.queryResourceById(resourceId);
		return resource;
	}
}
